package com.vanEngine.util
{
	
	public class ArrayUtils
	{
	  
	    public static function objToArray(obj:Object):Array
	    {
	        if (obj == null) 
	            return [];
	        
	        else if (obj is Array)
	            return obj as Array;
	        
	        else
	            return [ obj ];
	    }
	    
	    public static function elemPropInclude( arr:Array, propName:String, val:* ):int
		{
			if( !arr )
			{
				return -1;
			}
		
			var len:int = arr.length;
			
			for( var i:int = 0; i < len; i++ )
			{
				var obj:* = arr[i];
				
				if( obj[propName] === val )
				{
					return i;
				}
				
			}
			
			return -1;
			
		}
	}

}
